<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>潜在客户报表</title>
<#include "../common/link.ftl" >
    <script type="text/javascript">
        $(function () {
            $(".chart_btn").on("click", function () {
                /*清除缓存,因为一旦加载就不会改变,需要清除*/
                $("#barModal").removeData("bs.modal");
                var url = $(this).data("url");
                $("#barModal").modal({
                    remote:url+"?"+$("#searchForm").serialize()
                });
                $("#barModal").modal("show");


            })
        })
    </script>
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
<#include "../common/navbar.ftl" >
    <!--菜单回显-->
<#assign currentMenu="customerChart"/>
<#include "../common/menu.ftl" >
    <div class="content-wrapper">
        <section class="content-header">
            <h1>潜在客户报表</h1>
        </section>
        <section class="content">
            <div class="box">
                <!--高级查询--->
                <div style="margin: 10px;">
                    <form class="form-inline" id="searchForm" action="/customerChart/list.do" method="post">
                        <div class="form-group">
                            <label for="keyword">关键字:</label>
                            <input type="text" class="form-control" id="keyword" name="keyword" value="${qo.keyword!}"
                                   placeholder="请输入姓名">
                        </div>
                        <div class="form-group">
                            <label for="type"> 时间段查询:</label>
                            <input type="text" class="form-control" style="width: 100px" name="beginDate"
                                   value="${qo.beginDate!}">
                        </div>
                        -
                        <div class="form-group">
                            <input type="text" class="form-control" style="width: 100px" value="${qo.endDate!}"
                                   name="endDate">
                        </div>
                        <div class="form-group">
                            <label for="status">分组类型:</label>
                            <select class="form-control" id="groupType" name="groupType">
                                <option value="e.name">员工</option>
                                <option value="DATE_FORMAT(c.input_time, '%Y')">年</option>
                                <option value="DATE_FORMAT(c.input_time, '%Y-%m')">月</option>
                                <option value="DATE_FORMAT(c.input_time, '%Y-%m-%d')"> 日</option>
                            </select>
                            <script type="text/javascript">
                                $("#groupType").val("${qo.groupType!}")
                            </script>
                            <button id="btn_query" class="btn btn-primary"><span
                                    class="glyphicon glyphicon-search"></span>查询
                            </button>
                            <button type="button" class="btn btn-info chart_btn"
                                    data-url="/customerChart/chartByBar.do">
                                <span class="glyphicon glyphicon-stats"></span> 柱状图
                            </button>
                            <button type="button" class="btn btn-warning chart_btn"
                                    data-url="/customerChart/chartByPie.do">
                                <span class="glyphicon glyphicon-dashboard"></span> 饼状图
                            </button>
                    </form>
                </div>
                <table class="table table-hover table-bordered">
                    <thead>
                    <tr>
                        <th>分组类型</th>
                        <th>潜在客户新增数</th>
                    </tr>
                    </thead>
                <#list result as entity>
                    <tr>
                        <td>${(entity.groupType)!}</td>
                        <td>${(entity.number)!}</td>
                    </tr>
                </#list>
                </table>
                <!--分页-->
        </section>
    </div>
<#include "../common/footer.ftl" >
</div>
<div class="modal fade" id="barModal">
    <div class="modal-dialog">
        <div class="modal-content">
        </div>
    </div>

</body>
</html>
